<html>
<header>
  <meta charset="utf-8" />
  <link href="<%=staticRelativePath%>/normalize.css" rel="stylesheet" type="text/css" />
  <link rel="stylesheet" href="<%=staticRelativePath%>/iconfont/iconfont.css">
  <style type="text/css">
    table {
      width: 100%;
    }

    table,
    th,
    td {
      border: 1px solid black;
      text-align: center;
    }
    table, th,span {
      font-weight: bold;
    }
    table,td{
      font-weight: normal;
    }
    .table-margin-top {
      margin-top: 20px;
    }
    hr {
      align-content: center;
      width: 100%;
      margin-top: 20px;
      margin-bottom: 20px;
    }

  </style>
</header>

<body style="padding-top: 15px;">
<div>
  <div style="text-align: left">
    <span><%= fileName %></span>
  </div>
  <div>
    <div style="text-align: left;"><span>1.对象属性分析</span></div>
    <div>
      <table>
        <tbody>
          <tr>
            <th>对象名</th>
            <th>属性名</th>
            <th>类型</th>
            <th>可见性</th>
            <th>值</th>
          </tr>
          <% for (let index = 0; index < dateObjectAnalyzer.length; index +=1) { 
            const dateObject = dateObjectAnalyzer[index]; %>
            <tr>
              <td><%= dateObject.name %></td>
              <td><%= dateObject.attrName %></td>
              <td><%= dateObject.type %></td>
              <td><%= dateObject.visibility %></td>
              <td><%= dateObject.value %></td>
            </tr>
          <% } %>
        </tbody>
      </table>
    </div>
    <hr/>
    <div style="text-align: left;"><span>2.变量生命周期和使用范围分析</span></div>
    <div>
      <table>
        <tbody>
          <tr>
            <th>变量名</th>
            <th>作用域</th>
            <th>变量种类</th>
            <th>所属文件</th>
            <th>所属函数</th>
            <th>生命周期</th>
          </tr>
          <% for (let index = 0; index < lifetimeAnalyzer.length; index +=1) { 
            const lifetimeData = lifetimeAnalyzer[index]; %>
            <tr>
              <td><%= lifetimeData.name %></td>
              <td><%= lifetimeData.scope %></td>
              <td><%= lifetimeData.storage %></td>
              <td><%= lifetimeData.fileName %></td>
              <td><%= lifetimeData.funcName %></td>
              <td><%= lifetimeData.lifetime %></td>
            </tr>
          <% } %>
        </tbody>
      </table>
    </div>
    <hr/>
    <div style="text-align: left;"><span>3.函数分析</span></div>
    <br/>
    <% for (let index = 0; index < functions.length; index +=1) { 
      const func = functions[index]; 
      const funcIndex = index + 1;%>
      <div style="text-align: left;"><span>3.<%= funcIndex %>.<%= func.functionName %></span></div>
      <br/>
      <div style="text-align: left;"><span>3.<%= funcIndex %>.1.函数信息概况</span></div>
     <div>
      <table>
        <tbody>
          <tr>
            <td style="width: 15%;">总行数</td>
            <td style="width: 35%;"><%= func.totalLines %></td>
            <td style="width: 15%;">注释行数</td>
            <td style="width: 35%;"><%= func.commentLines %></td>
          </tr>
          <tr>
            <td>空行</td>
            <td><%= func.emptyLines %></td>
            <td>注释率</td>
            <td><%= func.commentLinesRate %></td>
          </tr>
          <tr>
            <td>可执行行数</td>
            <td colspan="3"><%= func.executableLines %></td>
          </tr>
          <tr>
            <td>扇入</td>
            <td><%= func.fanIn %></td>
            <td>扇出</td>
            <td><%= func.fanOut %></td>
          </tr>
          <tr>
            <td>循环个数</td>
            <td><%= func.loopCount %></td>
            <td>循环深度</td>
            <td><%= func.loopDepthMax %></td>
          </tr>
          <tr>
            <td>基本圈复杂度</td>
            <td><%= func.essentialComplexity %></td>
            <td>圈复杂度</td>
            <td><%= func.cycleComplexity %></td>
          </tr>
          <tr>
            <td>return语句个数</td>
            <td><%= func.returnCount %></td>
            <td>程序出口个数</td>
            <td><%= func.exitCount %></td>
          </tr>
          <tr>
            <td>函数值分析</td>
            <td colspan="3">
              <% for (let j = 0; j < func.clearPath.length; j += 1) {
                if (j > 0) { %><br />
              <% } %>
                <%= func.clearPath[j].value %>
              <% } %>
            </td>
          </tr>
        </tbody>
      </table>
     </div>
     <br/>
     <div style="text-align: left;"><span>3.<%= funcIndex %>.2.信息流追踪</span></div>
     <div>
      <table>
        <tbody>
          <tr>
            <th>变量名</th>
            <th>位置</th>
          </tr>
          <% for (let i = 0; i < func.pathTracker.length; i +=1) { 
            const pathTrackerData = func.pathTracker[i]; %>
            <tr>
              <td><%= pathTrackerData.name %></td>
              <td><% for (let j = 0; j < pathTrackerData.paths; j += 1){ 
                const pathData = pathTrackerData.paths[j];%>
                <%= pathData.path %> <br />
              <% } %></td>
            </tr>
          <% } %>
        </tbody>
      </table>
    </div>
    <br/>
    <div style="text-align: left;"><span>3.<%= funcIndex %>.3.数据依赖分析</span></div>
    <div>
      <table>
        <tbody>
          <tr>
            <th>变量名</th>
            <th>定义类型</th>
            <th>直接强依赖</th>
            <th>直接弱依赖</th>
            <th>条件强依赖</th>
            <th>条件弱依赖</th>
          </tr>
          <% for (let i = 0; i < func.dependencyAnalyzer.length; i +=1) { 
            const dependencData = func.dependencyAnalyzer[i]; %>
            <tr>
              <td><%= dependencData.name %></td>
              <td><%= dependencData.definitionType %></td>
              <td><%= dependencData.directDependStrongly %></td>
              <td><%= dependencData.directDependWeakly %></td>
              <td><%= dependencData.conditionalDependStrongly %></td>
              <td><%= dependencData.conditionalDependWeakly %></td>
            </tr>
          <% } %>
        </tbody>
      </table>
    </div>
    <br/>
    <div style="text-align: left;"><span>3.<%= funcIndex %>.4.信息流统计分析</span></div>
    <div>
      <table>
        <tbody>
          <tr>
            <th>变量名</th>
            <th>数据大小（bit）</th>
            <th>使用频率</th>
            <th>路径长度</th>
          </tr>
          <% for (let i = 0; i < func.flowStatisticsAnalyzer.length; i +=1) { 
            const flowStatisticsData = func.flowStatisticsAnalyzer[i]; %>
            <tr>
              <td><%= flowStatisticsData.name %></td>
              <td><%= flowStatisticsData.dataVolume %></td>
              <td><%= flowStatisticsData.frequency %></td>
              <td><%= flowStatisticsData.pathLen %></td>
            </tr>
          <% } %>
        </tbody>
      </table>
    </div>
    <hr/>
    <% } %>
  </div>
</div>
</body>

</html>
